Public Class frmToolsOptionsNewTool

    Private Sub btnNewComputerToolBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewComputerToolBrowse.Click
        dlgNewComputerToolOpen.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
        If dlgNewComputerToolOpen.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
            If dlgNewComputerToolOpen.FileName <> "" Then
                txtNewComputerToolCmd.Text = ControlChars.Quote & dlgNewComputerToolOpen.FileName & ControlChars.Quote
            End If
        End If
    End Sub

    Private Sub btnNewComputerToolOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewComputerToolOK.Click
        Dim toolOK As Boolean = True

        If txtNewComputerToolText.Text = "" Then toolOK = False
        If txtNewComputerToolCmd.Text = "" Then toolOK = False

        If toolOK Then
            DialogResult = Windows.Forms.DialogResult.OK
        Else
            MsgBox("Both the text and the command line must be filled in before you can add this tool.")
        End If
    End Sub

    Private Sub btnNewComputerToolCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewComputerToolCancel.Click
        DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub

    Private Sub frmToolsOptionsNewTool_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtNewComputerToolCmd.Text = ""
        txtNewComputerToolText.Text = ""
        txtNewComputerToolText.Focus()
    End Sub
End Class